<template>
  <div class="home">
    <div class="car">
      <carousel v-if="imgUrl" :imgUrl="imgUrl"/>
    </div>
    <div class='new'>
      <h2>新活动</h2>
      <card v-if="hosActivity" :list="hosActivity"/>
    </div>
  </div>
</template>

<script>
import carousel from 'components/personal/carousel'
import card from 'components/share/home/card'
import {carouselUrl} from 'request/carousel'
import {activityData} from 'request/activity'
export default {
    name:'home',
    data(){
      return{
        imgUrl:null,
        hosActivity:null,
      }
    },
    components:{
      carousel,
      card
    },
    methods:{
      getCarouse(){
        carouselUrl().then(res=>this.imgUrl=res.data)
        activityData().then(res=>this.hosActivity=res.data)
      }
    },
    mounted(){
      this.getCarouse()
    }
}
</script>

<style lang="less" scoped>
.home{
  margin-bottom: 4.5rem;
}
</style>